let reg = /^[1-9]\d{10}$/
let phone = document.querySelector("#phone")
let getYzm = document.querySelector("#getYzm")
let quxiao = document.querySelector(".quxiao")
let mark = document.querySelector("#mark")
phone.oninput = () => {
    quxiao.classList.remove("none")
}
getYzm.onclick = () => {
    console.log(this);
    if(reg.test(phone.value)){
        console.log("验证成功")
        axios.post("http://localhost:3001/register", {
            phone: phone.value,
            pwd: "111111",
            type: "0",
            img: "http://pic5.40017.cn/i/ori/PELe6f5TBC_90x90_00.jpg"
        }).then(res => {
            console.log(res);
            location.href="City-Travel-login.html"
            localStorage.setItem('userPhone',phone.value)
        }).catch(err => {
            console.log(err);
        })
    }else{
        mark.classList.remove("none")
        setInterval(() => {
            mark.classList.add("none")
        },1000) 
    }
}
quxiao.onclick = () => {
    phone.value = ''
}